CreateCaret (user32)
Last changed: -31.43.223.17

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth,
   int nHeight);

User-Defined Types:

None.

Notes:

Windows allows only one caret per message queue. To add a caret to a control, handle the WM_SETFOCUS message, or the GotFocus event, or override OnGotFocus if you're writing a custom control, and call CreateCaret from the message or event handler. You should also handle WM_KILLFOCUS, LostFocus or OnLostFocus and call DestroyCaret. You will also need to call ShowCaret to make the caret visible, and SetCaretPos to set its position.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
CreateCaret on MSDN